package cn.com.zpark.servlet_request;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;

/**
 * @PackageName: cn.com.zpark.servlet_request
 * @ClassName: RequestDemo07
 * @Description:
 * @author: RZS
 * @date: 2021/11/14  16:34
 */
@WebServlet("/rd7.do")
public class RequestDemo07 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 绑定数据到请求对象中
        request.setAttribute("date", new Date());

        // 转发到RequestDemo08
        request.getRequestDispatcher("rd8.do").forward(request, response);
    }
}
